package org.springbus.ff.conf;

import lombok.Data;
import org.springbus.ff.filter.Pos;

@Data
public class FFBaseConf {
    private String type;
    /**
     * @default 0
     */
    private int x = 0;
    /**
     * @default 0
     */
    private int y;
    /**
     * @default 1
     */
    private float scale;
    /**
     * @default 0
     */
    private float rotate=0;
    /**
     * @default 1
     */
    private float opacity=1f;
    /**
     * @default 0
     */
    private Float duration=0f;
    private float tansDuration;
    /**
     * @default false
     */
    private boolean preload;
    private int width;
    private int height;
    private String path;
    private String url;
    private String image;
    private String name;
    private String color;

    private int fps = 25;
    private boolean debug;
    private String cacheDir="./";
    private String outputDir="./";
    private String cacheFormat="mp4";
    private int threads = 2;
    private boolean upStreaming;
    private String output;
    private String audio;
    private boolean audioLoop;

    private int fontSize = 24;

    private String backgroundColor;

    private String text = "";
    private String font;
    private String fontfile;
    private String fontFamily;


    //
    private Float time;
    private Float from;
    private Float to = null;
    private String showType;
    private Float add;
    private boolean ing;
    private Float delay;
    private String elsestr;

    private String ease;

    private Pos moveFrom;
    private Pos moveTo;
    private Pos moveAdd;

    private Float alpha;
    private boolean pad;
    private String size;

    private String strFrom;
    private String strTo;
    private boolean log;


    public FFBaseConf() {
        if(moveFrom==null){
            moveFrom=(new Pos(0,0));
        }
        if(moveAdd==null){
            moveAdd=new Pos(0,0);
        }
        if(name==null){
            name="";
        }
    }

    public FFBaseConf(String showType, Float time, Float delay, boolean ing) {
        this();
        this.showType = showType;
        this.time = time;
        this.delay = delay;
        this.ing = ing;
    }

    public FFBaseConf(String type, FFBaseConf conf, String from, String to, String name) {
        this();
        this.showType = conf.getShowType();
        this.time = conf.getTime();
        this.delay = conf.getDelay();
        this.ing = conf.isIng();
        this.type = type;
        this.strFrom = from;
        this.strTo = to;
        this.name = name;
    }

    public FFBaseConf(String type, FFBaseConf conf, String from, String to, String name, String ease) {
        this();
        this.showType = conf.getShowType();
        this.time = conf.getTime();
        this.delay = conf.getDelay();
        this.ing = conf.isIng();
        this.type = type;
        this.strFrom = from;
        this.strTo = to;
        this.name = name;
        this.ease = ease;
    }

    public FFBaseConf(String type, FFBaseConf conf, Float from, Float to, String size, boolean pad) {
        this();
        this.showType = conf.getShowType();
        this.time = conf.getTime();
        this.delay = conf.getDelay();
        this.ing = conf.isIng();
        this.type = type;
        this.from = from;
        this.to = to;
        this.size = size;
        this.pad = pad;
    }

    public FFBaseConf(String type, FFBaseConf conf, Float from, Float to, String size) {
        this();
        this.showType = conf.getShowType();
        this.time = conf.getTime();
        this.delay = conf.getDelay();
        this.ing = conf.isIng();
        this.type = type;
        this.from = from;
        this.to = to;
        this.size = size;
    }

    public FFBaseConf(String type, FFBaseConf conf, String from, Pos add) {
        this();
        this.showType = conf.getShowType();
        this.time = conf.getTime();
        this.delay = conf.getDelay();
        this.ing = conf.isIng();
        this.type = type;
        this.strFrom = from;
        this.moveAdd = add;
    }


    public FFBaseConf(String type, FFBaseConf conf) {
        this();
        this.showType = conf.getShowType();
        this.time = conf.getTime();
        this.delay = conf.getDelay();
        this.ing = conf.isIng();
        this.type = type;
    }

    public FFBaseConf(String type, Float time, Float delay) {
        this.type = type;
        this.time = time;
        this.delay = delay;
    }

}
